package com.hjj.services;

import com.hjj.beans.Subject;
import com.hjj.mapper.SubjectMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;

@Service
public class SubjectServicesImp implements SubjectServices{
     @Autowired
     SubjectMapper subjectMapper;

    @Override
    public ArrayList<Subject> getAll() {
        return subjectMapper.getAll();
    }

    @Override
    public Subject get(int id) {
        return subjectMapper.get(id);
    }

    @Override
    public boolean add(Subject subject) {
        return subjectMapper.add(subject) > 0 ? true : false;
    }

    @Override
    public boolean edit(Subject subject) {
        return subjectMapper.edit(subject) > 0 ? true : false;
    }

    @Override
    public boolean del(int id) {
        return subjectMapper.del(id) > 0 ? true : false;
    }
}
